﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Web;
using DHQGHN.DAL.Models.DanhMuc;

namespace DHQGHN.Services.DanhMuc
{
    [ServiceContract]
    public interface IMasterListService
    {

        /// <summary>
        /// 
        /// </summary>
        /// <param name="listName"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetNewLists/{lastUpdated}"
            )]
        IEnumerable<DAL.Models.DanhMuc.MasterList> GetNewLists(string lastUpdated);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="listName"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetNewListsTablet/{lastUpdated}"
            )]
        MasterListTablet GetNewListsTablet(string lastUpdated);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="listName"></param>
        /// <returns></returns>
        [OperationContract]
        [AspNetCacheProfile("GetAllByListName")]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetAllByListName/{listName}"
            )]
        IEnumerable<MasterList> GetAllByListName(string listName);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="listName"></param>
        /// <param name="pageSize"></param>
        /// <param name="pageIdx"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetAllByListNamePaging/{listName}/{pageSize}/{pageIdx}"
            )]
        IEnumerable<MasterList> GetAllByListNamePaging(string listName, string pageSize, string pageIdx);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="listName"></param>
        /// <param name="code"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetOneByCode/{listName}/{code}"
            )]
        MasterList GetOneByCode(string listName, string code);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="listName"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetNewCommonList/{lastUpdated}"
            )]
        CommonListTablet GetNewCommonList(string lastUpdated);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="listName"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetNewCommonListPaging/{lastUpdated}/{pageSize}/{pageIdx}"
            )]
        CommonListTablet GetNewCommonListPaging(string lastUpdated, string pageSize, string pageIdx);


        /// <summary>
        /// 
        /// </summary>
        /// <param name="listName"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "DownloadDanhMuc/{lastUpdated}/{pageSize}/{pageIdx}"
            )]
        ListDataObject DownloadDanhMuc(string lastUpdated, string pageSize, string pageIdx);

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "DownloadAddressAndAdmUnitExt/{userName}/{lastUpdated}/{pageSize}/{pageIdx}"
            )]
        ADDRESS_ADMUNITEXT_RET DownloadAddressAndAdmUnitExt(string userName, string lastUpdated, string pageSize, string pageIdx);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="listName"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "DownloadDuLieuBanDau/{EnumeratorID}/{numberOfHouseHold}/{pageIdx}"
            )]
        HouseHoldAndResDataObject DownloadDuLieuBanDau(string EnumeratorID, string numberOfHouseHold, string pageIdx);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="listName"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "DownloadDuLieuBanDauType2/{EnumeratorID}/{numberOfHouseHold}/{pageIdx}"
            )]
        HouseHoldAndResDataObjectType2 DownloadDuLieuBanDauType2(string EnumeratorID, string numberOfHouseHold, string pageIdx);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="listName"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "DownloadDuLieuDaDieuTra/{EnumeratorID}/{numberOfHouseHold}/{pageIdx}"
            )]
        HouseHoldAndResDataObject DownloadDuLieuDaDieuTra(string EnumeratorID, string numberOfHouseHold, string pageIdx);

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "DownloadDuLieuDaDieuTraTest/{EnumeratorID}/{numberOfHouseHold}/{pageIdx}"
            )]
        HouseHoldAndResDataObject DownloadDuLieuDaDieuTraTest(string EnumeratorID, string numberOfHouseHold, string pageIdx);

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "DownloadDuLieuDaDieuTraType2/{EnumeratorID}/{numberOfHouseHold}/{pageIdx}"
            )]
        HouseHoldAndResDataObjectType2 DownloadDuLieuDaDieuTraType2(string EnumeratorID, string numberOfHouseHold, string pageIdx);
    }
}